package com.xy.service.impl;


import com.xy.repository.IPleadingsDao;
import com.xy.service.IPleadingsService;
import com.xy.vo.PleadingsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;
import java.util.stream.Collectors;

@Service
public class PleadingsServiceImpl implements IPleadingsService {
    private final IPleadingsDao pleadingsDao;

    @Autowired
    public PleadingsServiceImpl(IPleadingsDao pleadingsDao) {
        this.pleadingsDao = pleadingsDao;
    }

    @Override
    public List<PleadingsVO> getAllPeadings() {
        List<PleadingsVO> pleadingsVOS = pleadingsDao.getAllPleadings().stream().map(PleadingsVO::new).collect(Collectors.toList());
        return pleadingsVOS;
    }
}
